fn main() {
    test1_explicit_type();
    println!("----------------------------");
    test2_integer_type();
    println!("----------------------------");
    test3_number_literal();
    println!("----------------------------");
    test4_float_type();
    println!("----------------------------");
    test5_calculate();
    println!("----------------------------");
    test6_bool_type();
    println!("----------------------------");
    test7_char_type();
    println!("----------------------------");
    test8_compound_type();
    println!("----------------------------");
}
fn test1_explicit_type() {
    //let guess = "42".parse().expect("Not a number!");
    let guess: u32 = "42".parse().expect("Not a number!");
    println!("The value of guess: {guess}");
}
fn test2_integer_type() {
    let num: i8 = -1;
    println!("The value of i8 num is: {num}");
    let num: u8 = 1;
    println!("The value of u8 num is: {num}");
    let num: i16 = -1;
    println!("The value of i16 num is: {num}");
    let num: u16 = 1;
    println!("The value of u16 num is: {num}");
    let num: i32 = -1;
    println!("The value of i32 num is: {num}");
    let num: u32 = 1;
    println!("The value of u32 num is: {num}");
    let num: i64 = -1;
    println!("The value of i64 num is: {num}");
    let num: u64 = 1;
    println!("The value of u64 num is: {num}");
    let num: i128 = -1;
    println!("The value of i128 num is: {num}");
    let num: u128 = 1;
    println!("The value of u128 num is: {num}");
}
fn test3_number_literal() {
    let num: i32 = 1_000;
    println!("The value of num(1_000) is: {num}");
    let num: i32 = 0xff;
    println!("The value of num(0xff) is: {num}");
    let num: i32 = 0o77;
    println!("The value of num(0o77) is: {num}");
    let num: i32 = 0b11110000;
    println!("The value of num(0b11110000) is: {num}");
    let num: u8 = b'A';
    println!("The value of num(b'A') is: {num}");
}
fn test4_float_type() {
    let num = 2.1; //f64
    println!("The value of f64 num is: {num}");
    let num: f32 = 2.2;
    println!("The value of f32 num is: {num}");
}
fn test5_calculate() {
    let sum = 5 + 10;
    println!("The value of sum is: {sum}");
    let diff = 95.4 - 34.2;
    println!("The value of diff is: {diff}");
    let mul = 4 * 30;
    println!("The value of mul is: {mul}");
    let div = 56.7 / 32.1;
    println!("The value of div is: {div}");
    let div_int = 5 / 3;
    println!("The value of div is: {div_int}");
}
fn test6_bool_type() {
    let t = true;
    println!("The value of t is: {t}");
    let f: bool = false;
    println!("The value of f is: {f}");
}
fn test7_char_type() {
    let c = 'c';
    println!("The value of c is: {c}");
    let uc: char = '中';
    println!("The value of uc is: {uc}");
}
fn test8_compound_type() {
    let tup = (500, 6.5, 1);
    let (x, y, z) = tup;
    println!("The value of x is: {x}");
    println!("The value of y is: {y}");
    println!("The value of z is: {z}");

    let tup: (i32, f64, u8) = (100, 232.2, 5);
    let x = tup.0;
    let y = tup.1;
    let z = tup.2;
    println!("The value of x is: {x}");
    println!("The value of y is: {y}");
    println!("The value of z is: {z}");

    let tup = ();
    let tup: () = ();

    let arr = [1, 2, 3];
    let arr: [i32; 5] = [1, 2, 3, 4, 5];
    let arr = [1; 6];
}
